package com.leonzhangxf.ioc;

/**
 * @author leonzhangxf
 */
public interface BeanFactory extends BeanDefinitionRegistry {

    /**
     * Initialize all beans.
     *
     * @throws Exception initialize failed.
     */
    void initializeBeans() throws Exception;

    /**
     * Get bean by id.
     *
     * @param id bean id.
     * @return bean
     */
    Object getBean(String id);

    /**
     * Get bean by type.
     *
     * @param type bean class.
     * @param <T>  bean
     * @return bean
     */
    <T> T getBean(Class<T> type);
}
